updating oE mem_copy

Memory Manipulation

mem_copy

<built-in> procedure mem_copy(atom destination, atom origin, integer len) 

copies a block of memory from an address to another.

Parameters:
  1. destination : an atom, the address at which data is to be copied
  2. origin : an atom, the address from which data is to be copied
  3. len : an integer, how many bytes are to be copied.
Comments:

The bytes of memory will be copied correctly even if the block of memory at destination overlaps with the block of memory at origin.

mem_copy(destination, origin, len) is equivalent to: poke(destination, peek({origin, len})) but is much faster.

Example 1:
dest = allocate(50) 
src = allocate(100) 
poke(src, {1,2,3,4,5,6,7,8,9}) 
mem_copy(dest, src, 9) 
See Also:

Using Data Bytes, mem_set, peek, poke, allocate, free

Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu